From b026cfdc1e2c766b0c9baadea7ec0a3d0daad361 Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Mon, 1 Oct 2018 17:29:00 +0200 Subject: [PATCH] no posix_fadvice on apple --- src/siri/db/buffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/siri/db/buffer.c b/src/siri/db/buffer.c index 3a484a9b..88d923a6 100644 --- a/src/siri/db/buffer.c +++ b/src/siri/db/buffer.c @@ -136,7 +136,9 @@ int siridb_buffer_open(siridb_t * siridb) return -1; } -#ifndef __APPLE__ +#ifdef __APPLE__ + rc = 0; /* no posix_fadvise on apple */ +#else rc = posix_fadvise(buffer_fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED); if (rc) { @@ -144,7 +146,7 @@ int siridb_buffer_open(siridb_t * siridb) } #endif - return 0; + return rc; } static void buffer__migrate_to_new(char * pt, size_t sz) -- 2.30.2